cmake_minimum_required(VERSION 3.0)
PROJECT(PSS_PLUGIN_LOGIC_MAKER)

if(UNIX)
	set(BIN_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/Build)
	set(LIB_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/Build)
else()
	set(BIN_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/Build)
	set(LIB_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/Build)
	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${BIN_OUTPUT_DIR}")
	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${BIN_OUTPUT_DIR}")
	set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${BIN_OUTPUT_DIR}")
	set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${BIN_OUTPUT_DIR}")
	set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${BIN_OUTPUT_DIR}")
	set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${BIN_OUTPUT_DIR}")
endif()

if(UNIX)
	#linux
	include(CheckCXXCompilerFlag)
	CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
	if(COMPILER_SUPPORTS_CXX11)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
	endif()
endif()

file(GLOB MAIN_FILES *.h *.cpp)
source_group("main_file" FILES ${MAIN_FILES})

include_directories(
	${PROJECT_SOURCE_DIR}/../third_include)

add_executable(PSS_PLUGIN_LOGIC_MAKER 
	${MAIN_FILES}
	)

#ifwindows	
#__DEBUG;_USRDLL;TEST_LOGIC_EXPORTS;_WINDOWS;%(PreprocessorDefinitions)
if(WIN32)
	message("OS is windows...")
	if(CMAKE_BUILD_TYPE MATCHES "debug")
		add_definitions(
		-D_DEBUG
		-D_USRDLL
		-DTEST_LOGIC_EXPORTS
		-D_WINDOWS)
	else()
		add_definitions(
		-DNDEBUG
		-D_USRDLL
		-DTEST_LOGIC_EXPORTS
		-D_WINDOWS)		
	endif()
endif()

set_target_properties(PSS_PLUGIN_LOGIC_MAKER PROPERTIES 
	OUTPUT_NAME_DEBUG PSS_PLUGIN_LOGIC_MAKER
	ARCHIVE_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR}
    RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR}
    LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR})
